;3.11 回文检测
(setf a '(a b c b a)
			b '(a b c c b a)
			c '(a b c c c c))

; mirror, 不支持奇数长度的格式
(defun mirror? (s)
	(let ((len (length s)))
		(and (evenp len)
				 (let ((mid (/ len 2)))
					 (equal (subseq s 0 mid)
									(reverse (subseq s mid)))))))

(format t "~A is mirror sent? : ~A~%" a (mirror? a))
(format t "~A is mirror sent? : ~A~%" b (mirror? b))
(format t "~A is mirror sent? : ~A~%" c (mirror? c))

; mirror, 支持基数长度如：a b c b a 这种格式
(defun my-mirror? (s)
	(let ((len (length s)))
		(and (> len 1)
				 (let ((left (truncate (/ len 2))))
					 (equal (subseq s 0 left)
									(reverse (subseq s (- len left))))))))

(format t "~A is mirror sent? : ~A~%" a (my-mirror? a))
(format t "~A is mirror sent? : ~A~%" b (my-mirror? b))
(format t "~A is mirror sent? : ~A~%" c (my-mirror? c))

